function onMapsClick(param)
{
    // 点击取消选中
    if (!geoName) {
        return;
    }

}

function getPlantStructure(){
    // 参数
    jQuery.ajaxSettings.async = false;
    var params = [];
    var geoLevel = getGeoLevel(geoName);
    params.push('parameters[national_id]=' + getNationalID(geoLevel, geoName));
    params.push('parameters[geo_level]=' + geoLevel);
    params.push('parameters[year]=' + jQuery('#edit-year').val());
    params.push('parameters[geo_name]=' + (!geoName ? geoChain[geoChain.length-1] : geoName));

    jQuery.getJSON(nonghuaBaseUrl + '/api/plant_structure?' + params.join('&'), function (json) {
        // 更新经济作物饼状图
        optionEconomics.series[0].data = json.economics;
        pieChartEconomics.setOption(optionEconomics, true);

        // 更新粮食作物饼状图
        optionGrains.series[0].data = json.grains;
        pieChartGrains.setOption(optionGrains, true);

        // 更新蔬菜水果饼状图
        optionVeges.series[0].data = json.veges;
        pieChartVeges.setOption(optionVeges, true);

        jQuery('#myModal').modal('show');
    });

}
/*******************************图表相关************************************/
/* 经济作物饼状图选项、参数 */
var optionEconomics = {
    title : {
        text: '经济作物',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    animantion: false,
    calculable : false,
    series : [
        {
            type:'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[]
        }
    ]
};
var optionGrains = {
    title : {
        text: '粮食作物',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    animantion: false,
    calculable : false,
    series : [
        {
            type:'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[]
        }
    ]
};
var optionVeges = {
    title : {
        text: '蔬菜水果',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    animantion: false,
    calculable : false,
    series : [
        {
            type:'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[]
        }
    ]
};

var pieChartEconomics = echarts.init(document.getElementById('divEconomics'));
var pieChartGrains = echarts.init(document.getElementById('divGrains'));
var pieChartVeges = echarts.init(document.getElementById('divVeges'));

jQuery(function($) {
    initMap("#map_previous", "#map_next");
});